package io.seata.samples.tcc.springboot.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ActionTwoController {

    @GetMapping("/prepare")
    public String prepare(@RequestParam(name = "param") String param) {
        String result = ":::: action-two-provider prepare, rpc called success, param:" + param + ".";
        System.out.println(result);
        return result;
    }

    @GetMapping("/commit")
    public String commit(@RequestParam(name = "param") String param) {
        String result = ":::: action-two-provider commit, rpc called success, param:" + param + ".";
        System.out.println(result);
        return result;
    }

    @GetMapping("/rollback")
    public String rollback(@RequestParam(name = "param") String param) {
        String result = ":::: action-two-provider rollback, rpc called success, param:" + param + ".";
        System.out.println(result);
        return result;
    }
}
